package digester;

import java.util.HashMap;
import java.util.Map;

//有子元素，添加两个方法，方法名不限定，在配置文件中使用
public class ClassBean {
	//private TeacherBean tb;//元素只有一个时，可以不用集合，只要能将元素保存下来
	private Map<String,StudentBean> studentBeans= new HashMap<String,StudentBean>();
	private Map<String,TeacherBean> teacherBeans= new HashMap<String, TeacherBean>();
	public void addStudentBean(StudentBean sb){
		studentBeans.put(sb.getId(), sb);
	}
	public StudentBean findStudentBean(String id){
		return studentBeans.get(id);
	}
	public void addTeacherBean(TeacherBean tb){
		teacherBeans.put(tb.getId(), tb);
	}
	public TeacherBean findTeacherBean(String id){
		return teacherBeans.get(id);
	}
	@Override
	public String toString() {
		return "ClassBean [studentBeans=" + studentBeans + ", teacherBeans="
				+ teacherBeans + "]";
	}
	
}
